<template>
  <div id="centreLeft1">
    <div class="bg-color-black">
      <div class="d-flex pt-2 pl-2">
        <span style="color:#5cd9e8">
          <icon name="chart-line"></icon>
        </span>
        <div class="d-flex">
          <span class="fs-xl text mx-2">{{ line }}</span>
        </div>
      </div>
      <div class="d-flex jc-center body-box">
        <dv-scroll-board :config="config" style="width:5rem;height:100%"/>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      "refreshData": null,
      line: "PVS6",
      config: {
        header: ["设备名称", "计数值", "设置值"],
        data: [],
        rowNum: 16,
        headerBGC: "#0f1325", //表头
        oddRowBGC: "#0f1325", //奇数行
        evenRowBGC: "#171c33", //偶数行
        align: ['left', 'center', 'center'],
        columnWidth: [278, 70, 70]
      }
    };
  },
  created() {
  },
  components: {},
  mounted() {
    this.getRecordListByLine(); //获取数据
    this.refreshData = window.setInterval(() => {
      setTimeout(this.getRecordListByLine, 0)
    }, 10000)
  },
  methods: {
    async getRecordListByLine() {
      const resData = await this.$http.get("/opc/device/get_record_List?proLine=" + this.line);
      if (resData.data.code === 0) {
        this.config = {
          header: ["设备名称", "计数值", "设置值"],
          data: resData.data.data,
          rowNum: resData.data.data.length,
          headerBGC: "#0f1325", //表头
          oddRowBGC: "#0f1325", //奇数行
          evenRowBGC: "#171c33", //偶数行
          align: ['left', 'center', 'center'],
          columnWidth: [278, 70, 70]
        }
      }
    }
  }
};
</script>
